package com.yotoodesign.dianba.ui;

import android.widget.Toast;

import com.baidu.mapapi.MKGeneralListener;
import com.baidu.mapapi.map.MKEvent;
import com.yotoodesign.dianba.app.GlobalApplication;

public class MyGeneralListener implements MKGeneralListener {

	 @Override
     public void onGetNetworkState(int iError) {
         if (iError == MKEvent.ERROR_NETWORK_CONNECT) {
             Toast.makeText(GlobalApplication.getInstance().getApplicationContext(), "您的网络出错啦！",
                 Toast.LENGTH_LONG).show();
         }
         else if (iError == MKEvent.ERROR_NETWORK_DATA) {
             Toast.makeText(GlobalApplication.getInstance().getApplicationContext(), "请输入正确的检索条件！",
                     Toast.LENGTH_LONG).show();
         }
         // ...
     }

     @Override
     public void onGetPermissionState(int iError) {
         if (iError ==  MKEvent.ERROR_PERMISSION_DENIED) {
             //授权Key错误：
             Toast.makeText(GlobalApplication.getInstance().getApplicationContext(), 
                     "请在 DemoApplication.java文件输入正确的授权Key！", Toast.LENGTH_LONG).show();
         }
     }

}
